package com.beautify.controller;

import com.beautify.entity.pojo.Result;
import com.beautify.service.PushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
public class XFMessageController {

    @Autowired
    private PushService pushService;

    @GetMapping("/xfModel")
    public Result test(String uid, String text) {
        if (StringUtils.isEmpty(uid) || StringUtils.isEmpty(text)) {
            log.error("uid或text不能为空");
            return Result.error("请输入询问内容");
        }
        return pushService.pushMessageToXFServer(uid, text);
    }

}
